local setmetatable = setmetatable

module(...) -->name the package according to the filename

local color_mt = {
  __type = "color",
  __index = function(t,k) 
    return getmetatable(t)[k]
  end,
  __newindex = function (t,k,v)
    error("attempt to set a nono valid field", 2)
  end
}

new = function(r,g,b,a)
  local v = {}
  v.r = r or 1
  v.g = g or 1
  v.b = b or 1  
  v.a = a or 1
  setmetatable(v,color_mt) 
  return v
end
